package com.edison.demo.until;

import java.util.Random;

/**
 * @author: Edison
 *  Generate random Chinese name
 */
public class ChineseNameGenerator {

    private ChineseNameGenerator(){
        throw new IllegalStateException("Utility class");
    }

    private static final Random RANDOM = new Random();

    /**
     * for random generate Chinese name
     */
    private static final String[] SURNAMES = {
            "王", "李", "张", "刘", "陈", "杨", "赵", "黄", "周", "吴",
            "徐", "孙", "胡", "朱", "高", "林", "何", "郭", "马", "罗",
            "梁", "宋", "郑", "谢", "韩", "唐", "冯", "董", "萧", "程",
            "曹", "袁", "邓", "许", "傅", "沈", "曾", "彭", "吕", "苏",
            "卢", "蒋", "蔡", "贾", "丁", "魏", "薛", "叶", "阎", "余"
    };
    private static final String[] GIVEN_NAMES = {
            "伟", "芳", "娜", "敏", "静", "丽", "强", "磊", "军", "洋",
            "勇", "艳", "杰", "娟", "涛", "明", "超", "秀英", "霞", "平",
            "刚", "桂英", "峰", "建华", "玲", "丹", "萍", "国强", "鑫", "玉",
            "春", "花", "强", "天", "磊", "然", "宇", "文", "君", "希",
            "博", "轩", "杰", "涵", "志", "瑞", "楠", "琳", "菲", "琪",
            "青", "宇航", "天宇", "阳", "瑞霖", "泽", "欣", "乐", "雨欣", "彬",
            "文轩", "子轩", "思颖", "若琳", "梦瑶", "思雨", "欣怡", "俊杰", "子涵", "海涛"
    };

    public static String generateChineseName() {
        // Select a random surname
        String surname = SURNAMES[RANDOM.nextInt(SURNAMES.length)];

        // Select either one or two characters for the given name
        String givenName = GIVEN_NAMES[RANDOM.nextInt(GIVEN_NAMES.length)];

        return surname + givenName;
    }


}
